package com.godofgamblers.hotelmanagementsystem.config;

import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*

@author huanglang

@create_time 2019-10-09 21:29

Nothing is difficult but bugs

*/
@Configuration
public class EhcacheConfig {
    @Bean
    public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
        EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
        //设置共享缓存，让认证、授权共享一块区域
        cacheManagerFactoryBean.setShared(true);
        return cacheManagerFactoryBean;
    }
}

